obj-$(CONFIG_HMDFS_FS) += hmdfs.o
ccflags-y += -I$(src)

hmdfs-y := main.o super.o inode.o dentry.o inode_root.o file_merge.o
hmdfs-y += hmdfs_client.o hmdfs_server.o inode_local.o inode_remote.o
hmdfs-y += inode_merge.o hmdfs_dentryfile.o file_root.o file_remote.o
hmdfs-y += file_local.o client_writeback.o server_writeback.o stash.o
hmdfs-y += hmdfs_share.o

hmdfs-y += comm/device_node.o comm/message_verify.o comm/node_cb.o
hmdfs-y += comm/connection.o comm/socket_adapter.o comm/transport.o

hmdfs-$(CONFIG_HMDFS_FS_ENCRYPTION) += comm/crypto.o
hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/authentication.o
hmdfs-$(CONFIG_HMDFS_FS_PERMISSION) += authority/config.o

ccflags-y += -I$(src) -Werror -Wall
ccflags-$(CONFIG_HMDFS_FS_ENCRYPTION) += -DCONFIG_HMDFS_FS_ENCRYPTION
ccflags-$(CONFIG_HMDFS_FS_PERMISSION) += -DCONFIG_HMDFS_FS_PERMISSION

# KERNELDIR := /lib/modules/$(shell uname -r)/kernel
# KERNELDIR := /root/openEuler_kernel/kernel/
KERNELDIR := /root/raspberrypi-kernel/
PWD := $(shell pwd)

export CONFIG_HMDFS_FS := m
export CONFIG_HMDFS_FS_ENCRYPTION := n
export CONFIG_HMDFS_FS_PERMISSION := n

all:
	$(MAKE) ARCH=arm64 -C $(KERNELDIR) M=$(PWD) modules
clean:
	rm -rf *.o */*.o .*.cmd */.*.cmd *.mod *.mod.c *.o.d .*.o.d *.ko Module.symvers modules.order
